Skip to main content
Version: 2.x.x

FetchEffectConfig


import { FetchEffectConfig } from "@hyper-fetch/core"

Description

Defined in effect/fetch.effect.types.ts:10

Preview

type FetchEffectConfig<T> = {
effectKey: string;
onError: (response: ClientResponseErrorType<ExtractError<T>>, command: CommandInstance) => void;
onFinished: (response: ClientResponseType<ResponseType, ExtractError<T>>, command: CommandInstance) => void;
onStart: (command: CommandInstance) => void;
onSuccess: (response: ClientResponseSuccessType<ResponseType>, command: CommandInstance) => void;
onTrigger: (command: CommandInstance) => void;
}

Structure

{
effectKey: string;
onError: (response: ClientResponseErrorType<ExtractError<T>>, command: CommandInstance) => void;
onFinished: (response: ClientResponseType<ResponseType, ExtractError<T>>, command: CommandInstance) => void;
onStart: (command: CommandInstance) => void;
onSuccess: (response: ClientResponseSuccessType<ResponseType>, command: CommandInstance) => void;
onTrigger: (command: CommandInstance) => void;
}